package com.example.myandroidapp1.entity;

public class Image {

	private static final String IMAGE_PREFIX = "http://166.78.125.197/mysite/web/";

	private long id;
	private String filepath;
	private String thumbnail;
	private String fullImage;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getFilepath() {
		return filepath;
	}

	public void setFilepath(String filepath) {
		this.filepath = IMAGE_PREFIX + filepath;
	}

	public String getThumbnail() {
		if (this.thumbnail == null && this.filepath != null) {
			this.thumbnail = getFilepath().replace(".jpg",
					"_gallerythumbnail.jpg");
		}
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	public String getFullImage() {
		if (this.fullImage == null && this.filepath != null) {
			this.fullImage = getFilepath().replace(".jpg", "_imagefull.jpg");
		}
		return fullImage;
	}

	public void setFullImage(String fullImage) {
		this.fullImage = fullImage;
	}

}
